﻿
Imports System.Data
Imports VSModel
Imports Cls_Common

Partial Class Control_TinMuaXe_Detail
    Inherits System.Web.UI.UserControl
#Region "Sub and Function "
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            If Not Request.QueryString("Id").ToString.Equals("0") Then
                hidID.Value = Request.QueryString("Id")
                ShowData()
            End If
        End If
    End Sub
    Protected Sub ShowData()
        Using data As New VSEntities
            Dim p As Tinmuaxe = (From q In data.Tinmuaxes Where q.Id = hidID.Value Select q).SingleOrDefault
            If Not p Is Nothing Then
                lblMatin.Text = IIf(IsNothing(p.MaTin) = True, "", p.MaTin)
                lblTieude.Text = IIf(IsNothing(p.TieuDe) = True, "", p.TieuDe)
                lblNoidung.Text = IIf(IsNothing(p.NoiDung) = True, "", p.NoiDung)

                lblStatusid.Text = IIf(IsNothing(p.StatusId) = True, "", p.Status.Title)
                lblBeffectivedate.Text = IIf(IsNothing(p.bEffectiveDate) = True, "", p.bEffectiveDate)
                lblPublisheddate.Text = IIf(IsNothing(p.PublishedDate) = True, "", p.PublishedDate)
                lblEeffectivedate.Text = IIf(IsNothing(p.eEffectiveDate) = True, "", p.eEffectiveDate)
                lblCreator.Text = IIf(IsNothing(p.Creator) = True, "", p.Creator)
                lblCreated.Text = IIf(IsNothing(p.Created) = True, "", p.Created)
                lblModifier.Text = IIf(IsNothing(p.Modifier) = True, "", p.Modifier)
                lblModified.Text = IIf(IsNothing(p.Modified) = True, "", p.Modified)
                lblTinmuaxekhoanggiaid.Text = IIf(IsNothing(p.TinMuaXeKhoangGiaId) = True, "", p.TinMuaXeKhoangGia.Title)
            End If
        End Using
    End Sub
#End Region
End Class
